﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class my_pubnews : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
        }
        else
        {
            myuid.Text = Request["myuid"].ToString();

            //根据登录的用户来指定其上传文件的路径
            string emailfolder = this.Session["ecrm_email"].ToString();
            Session["FCKeditor:UserFilesPath"] = "/easycrm/uploadfiles/" + emailfolder + "/";
        }
    }
    protected void btnWrite_Click(object sender, EventArgs e)
    {
        string userid = myuid.Text;
        string articletitle = "xxx";
        string acontent = fck_content.Value;
        acontent=acontent.Replace("'","\"");

        TCMSArticle oArticle = new TCMSArticle();
        oArticle.GetNewID();
        oArticle.Title = articletitle;
        oArticle.AContent = acontent;
        oArticle.Issue_time = System.DateTime.Now;
        oArticle.UserID = userid;
        TUser oUser = new TUser(userid);
        oUser.Select();
        oArticle.Author = oUser.BigName;
        //---
        oArticle.Columns = "C01";
        oArticle.SubTitle = "";
        oArticle.Keywords = "";
        oArticle.Foreword = "";
        oArticle.Inure_time = System.DateTime.Now;
        oArticle.Abort_time = System.DateTime.Now;
        oArticle.Source = "";
        oArticle.Publisher = "";
        oArticle.PV = 0;
        oArticle.Source = "";
        oArticle.ALevel = 0;
        oArticle.Grade = 0;
        oArticle.Chknotice = "";
        oArticle.OrderbyTime = System.DateTime.Now;
        oArticle.OrderbyNum = 0;
        oArticle.Relations = "";
        oArticle.HtmlStatus = 0;
        oArticle.HtmlFileName = "";
        oArticle.HtmlPages = 1;
        oArticle.PageTitles = "";
        //---
        oArticle.Insert();
    }
}
